import java.net.DatagramPacket;
import java.net.DatagramSocket;

public class UDPClient {
 		// 李兴华高薪就业编程训练营
        public static void main(String[] args) throws Exception { 		// 沐言科技：www.yootk.com
            DatagramSocket client = new DatagramSocket(9999); 			// 客户端监听端口
            byte data[] = new byte[1024]; 				// 接收信息
            DatagramPacket packet = new DatagramPacket(data, data.length); // 接收数据报
            System.out.println("【UDPClient】客户端等待服务器端发送消息 ..........");
            client.receive(packet); 			// 消息接收
            System.out.println("【UDPClient】接收到消息，消息内容为：" +
                    new String(data, 0, packet.getLength()));
            client.close();			// 关闭客户端
        }
    }


